$(document).ready(function(){
		var win = window.dialogArguments;
		var url = '/schedule/querySchedule?flag='+win;//win = 系院ID+专业ID+班级ID("all")+专业名+班级名+课表名
		$.ajax({
			url: url,
			success:function(data){
				$(data.root).each(function(i,jAll){
					    //<tr><td><li value="课称名称,老师名称,教室名称,总课时,scheduleId">课程</li></td><td>老师</td><td>班级</td><td>教室</td><td>总课时</td><td>周课时</td></tr>课称名称-老师名称-教室名称-总课时-scheduleId
						$("#data").append("<tr align='center'><td width='10%'>"+(i+1)+"</td><td width='35%' align='left'><li value='"+jAll.courseName+","+jAll.teacherName+","+jAll.classroomName+","+jAll.totalTime+","+jAll.scheduleId+","+jAll.weeks+"'>"+jAll.courseName+"</li></td><td width='20%' >"+jAll.teacherName+"</td><td width='15%'>"+jAll.classroomName+"</td><td width='10%'>"+jAll.totalTime+"</td><td width='10%'>"+jAll.weekTime+ "</td></tr>");
				});
			}
	});

	$("li").live('mouseover',function(event){
			$(this).css("cursor","pointer");
		}).live('click',function(event){
			//alert($(this).attr("value"));
			window.returnValue = $(this).attr("value");
			window.close();
		});
		
		
		
		
		//弹出教室查询界面
		//$("li").live('mouseover',function(event){
			//$(this).css("cursor","pointer");
		//}).live('click',function(event){
			//var newwin = window.showModalDialog("choiceClassroom.jsp", "", "dialogTop:"+event.screenY +"px;dialogWidth:700px;dialogHeight:300px; dialogLeft:"+event.screenX+"px;modal=yes");
			//if(newwin!=null){
				//if(newwin!=""){
					//window.returnValue = $(this).attr("value")+"-"+newwin+"-"+$(this).text();//teachersRCourseID+classroomId+classroomName+courseName(teacherName)
					//window.close();
				//}
			//}	
			
		//});
});
